Skip to content

Frontend/cosmo encumber updates#1465

Merged
isabeleliassen merged 7 commits intocsg-org:mainfrom
InspiringApps:frontend/cosmo-encumber-updates
Apr 21, 2026
Merged

Frontend/cosmo encumber updates#1465
isabeleliassen merged 7 commits intocsg-org:mainfrom
InspiringApps:frontend/cosmo-encumber-updates

Conversation

@jsandoval81
Copy link
Copy Markdown
Collaborator

@jsandoval81 jsandoval81 commented Apr 14, 2026

Requirements List

  • None

Description List

  • In license & privilege card encumber modals:
    • Disciplinary action input - only have these values available for cosmetology:
      • Suspension
      • Revocation
      • Surrender of license
    • Basis for action / NPDB category input:
      • Label should just be "Basis for action" for cosmetology
      • Should only be a single-select (dropdown) for cosmetology
      • Should only have these values available for cosmetology:
        • Fraud (for cosmo only)
        • Consumer harm (for cosmo only)
        • Other

Testing List

  • yarn test:unit:all should run without errors or warnings
  • yarn serve should run without errors or warnings
  • yarn build should run without errors or warnings
  • Code review
  • Testing
    • Login as state staff user for cosmetology
    • Locate cosmetology practitioners with licenses & privileges to encumber
    • Encumber a license
      • See Description List above
    • Encumber a privilege
      • See Description List above
    • Switch to state staff for any of the other compacts
    • Locate cosmetology practitioners with licenses & privileges to encumber
    • Confirm encumber license UI is still as expected
      • Original list values for discipline & NPDB, NPDB label, NPDB multi-select, no regressions
    • Confirm encumber privilege UI is still as expected
      • Original list values for discipline & NPDB, NPDB label, NPDB multi-select, no regressions

Closes #1315

Summary by CodeRabbit

  • New Features

    • Mode-specific filtering for discipline and NPDB category options.
    • Conditional single vs. multi-select NPDB category input based on app mode.
    • New encumbrance basis label added to UI.
    • Discipline status row now visible for JCC mode or admin users.
  • Bug Fixes

    • NPDB category values normalized so submissions always send an array.
  • Style

    • Adjusted spacing rules in form layouts.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3b45847d-8baf-42ce-811b-e1028de74d09

📥 Commits

Reviewing files that changed from the base of the PR and between 2c95a70 and f913d7c.

📒 Files selected for processing (4)
  • webroot/src/components/LicenseCard/LicenseCard.ts
  • webroot/src/components/PrivilegeCard/PrivilegeCard.ts
  • webroot/src/locales/en.json
  • webroot/src/locales/es.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • webroot/src/locales/en.json
  • webroot/src/locales/es.json

📝 Walkthrough

Walkthrough

Mode-aware encumbrance changes: NPDB category and discipline option lists now vary by app mode; NPDB input toggles between multi- and single-select; encumbrance submission normalizes NPDB categories to an array; locales and mock API signature updated; minor CSS selector changes for .static-input spacing.

Changes

Cohort / File(s) Summary
Component Styling
webroot/src/components/LicenseCard/LicenseCard.less, webroot/src/components/PrivilegeCard/PrivilegeCard.less
Changed .static-input selector from &:not(:last-child) to &:first-child, altering which elements receive margin-bottom: 1.2rem.
Component Logic – NPDB & Discipline Filtering
webroot/src/components/LicenseCard/LicenseCard.ts, webroot/src/components/PrivilegeCard/PrivilegeCard.ts
Added isAppModeJcc / isAppModeCosmetology getters; mode-dependent filtering for encumberDisciplineOptions and npdbCategoryOptions; introduced shouldAllowNpdbMultiSelect; switched validation/value shapes and normalized npdbCategories to always submit as an array; mock-populate and init logic updated to match multi/single modes; minor destructuring refactor in submit flows.
Component Templates – Conditional NPDB Input Rendering
webroot/src/components/LicenseCard/LicenseCard.vue, webroot/src/components/PrivilegeCard/PrivilegeCard.vue
NPDB input now conditionally renders InputSelectMultiple when shouldAllowNpdbMultiSelect is true, otherwise renders a single InputSelect, binding to the same form field.
Localization
webroot/src/locales/en.json, webroot/src/locales/es.json
Added licensing.encumberBasisLabel (en) / common.encumber.encumberBasisLabel (es) and inserted npdbTypes entry for Consumer Harm.
Mock API
webroot/src/network/mocks/mock.data.api.ts
Added a new npdbCategory parameter to DataApi.encumberLicense() signature (parameter currently unused in returned mock payload).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Component as License/Privilege Component
    participant Store as Vuex Store
    participant API as DataApi (mock)
    User->>Component: open encumber modal / submit form
    Component->>Store: read isAppModeJcc / isAppModeCosmetology
    Store-->>Component: return mode flags
    alt JCC mode (multi)
        Component->>Component: render InputSelectMultiple, Joi.array() validation
        Component->>API: encumberLicense(..., npdbCategory, npdbCategories: array, startDate)
    else Cosmetology / other (single)
        Component->>Component: render InputSelect, Joi.string() validation
        Component->>API: encumberLicense(..., npdbCategory, npdbCategories: [value], startDate)
    end
    API-->>Component: mock response
    Component-->>User: show result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • jlkravitz
  • isabeleliassen

Poem

🐰 I hopped through forms and locale trees,
I nudged selects to fit app keys.
Single or many, arrays now play,
Spacing tweaked — I hopped away. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Frontend/cosmo encumber updates' is vague and doesn't clearly convey the main changes; 'cosmo encumber updates' lacks specificity about what was updated. Use a more descriptive title like 'Restrict cosmetology encumber modals to single-select NPDB and specific discipline options' to clarify the main change.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The PR description covers requirements, implementation details, and testing steps; it aligns with the template structure with complete requirements, description, and testing lists.
Linked Issues check ✅ Passed The code changes implement the frontend encumbrance flow with cosmetology-specific discipline/basis-for-action restrictions [#1315], providing conditional UI logic and proper form validation/serialization.
Out of Scope Changes check ✅ Passed All changes align with cosmetology encumber modal requirements: discipline/NPDB filtering, single vs multi-select logic, label updates, and mock data adjustments; no unrelated scope creep detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
webroot/src/components/LicenseCard/LicenseCard.ts (1)

273-305: Consider centralizing the NPDB app-mode option shaping.

This logic now mirrors webroot/src/components/PrivilegeCard/PrivilegeCard.ts:245-272. Pulling the mode-specific filtering/value-normalization into a shared helper/composable would reduce drift between the license and privilege encumber flows.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@webroot/src/components/LicenseCard/LicenseCard.ts` around lines 273 - 305,
Move the mode-specific NPDB option shaping into a shared helper/composable and
use it from both LicenseCard.get npdbCategoryOptions and PrivilegeCard (the
duplicated logic currently in the npdbCategoryOptions getter and PrivilegeCard's
equivalent block); implement a single function (e.g.,
normalizeNpdbOptions(options, { isAppModeJcc, isAppModeCosmetology })) that
accepts the base options from this.$tm('licensing.npdbTypes') and returns the
filtered/normalized list (including lowercasing values for cosmetology,
injecting the empty select option, and excluding fraud/consumer harm for JCC),
then replace the in-place transformations in npdbCategoryOptions and the
PrivilegeCard code with calls to that helper and keep shouldAllowNpdbMultiSelect
as the simple boolean derived from isAppModeJcc.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@webroot/src/components/LicenseCard/LicenseCard.ts`:
- Around line 547-552: In the encumbrance object construction inside
LicenseCard.ts (the investigation submit path), replace the incorrect use of
formData.encumberModalNpdbCategories.value for the startDate with the proper
start-date field from the form (e.g., formData.encumberModalStartDate.value or
the form key used for the start date in the component). Update the startDate
assignment so it reads the actual start-date form value instead of the NPDB
categories value to prevent turning date into category data.

In `@webroot/src/components/PrivilegeCard/PrivilegeCard.less`:
- Around line 314-316: The current rule using &:first-child on the static row
adds margin when there is only a single .static-input, creating an unwanted gap;
update the selector so the margin-bottom is applied only when the element is not
the last child (e.g., change the &:first-child rule to use &:not(:last-child) or
otherwise apply margin-bottom to .static-input elements except the last one) so
single-field static rows do not get extra bottom spacing; locate this in the
PrivilegeCard styles where the .static-container/.static-input first-child rule
is defined and replace the selector accordingly.

In `@webroot/src/components/PrivilegeCard/PrivilegeCard.ts`:
- Around line 259-265: The code is lowercasing NPDB category keys during the
options mapping (in the options = options.filter(...).map(...) block), which
breaks exact-match downstream lookups for licensing.npdbTypes like
"Fraud"/"Consumer Harm"/"Other"; remove the transformation so option.value is
not modified (i.e., delete the option.value = option.value?.toLowerCase() line)
and leave the filter using includeList.includes(option.value) intact (or, if
null-safety is needed, preserve option.value as-is but guard against undefined
without changing case).

---

Nitpick comments:
In `@webroot/src/components/LicenseCard/LicenseCard.ts`:
- Around line 273-305: Move the mode-specific NPDB option shaping into a shared
helper/composable and use it from both LicenseCard.get npdbCategoryOptions and
PrivilegeCard (the duplicated logic currently in the npdbCategoryOptions getter
and PrivilegeCard's equivalent block); implement a single function (e.g.,
normalizeNpdbOptions(options, { isAppModeJcc, isAppModeCosmetology })) that
accepts the base options from this.$tm('licensing.npdbTypes') and returns the
filtered/normalized list (including lowercasing values for cosmetology,
injecting the empty select option, and excluding fraud/consumer harm for JCC),
then replace the in-place transformations in npdbCategoryOptions and the
PrivilegeCard code with calls to that helper and keep shouldAllowNpdbMultiSelect
as the simple boolean derived from isAppModeJcc.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea11714b-da99-4c3a-b7cb-7af4e42ee2a9

📥 Commits

Reviewing files that changed from the base of the PR and between 3d8ed15 and f0afb3f.

⛔ Files ignored due to path filters (1)
  • webroot/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • webroot/src/components/LicenseCard/LicenseCard.less
  • webroot/src/components/LicenseCard/LicenseCard.ts
  • webroot/src/components/LicenseCard/LicenseCard.vue
  • webroot/src/components/PrivilegeCard/PrivilegeCard.less
  • webroot/src/components/PrivilegeCard/PrivilegeCard.ts
  • webroot/src/components/PrivilegeCard/PrivilegeCard.vue
  • webroot/src/locales/en.json
  • webroot/src/locales/es.json
  • webroot/src/network/mocks/mock.data.api.ts

Comment thread webroot/src/components/LicenseCard/LicenseCard.ts Outdated
Comment thread webroot/src/components/PrivilegeCard/PrivilegeCard.less
Comment thread webroot/src/components/PrivilegeCard/PrivilegeCard.ts Outdated
@jsandoval81 jsandoval81 requested a review from rmolinares April 16, 2026 17:01
@jsandoval81 jsandoval81 requested a review from jlkravitz April 17, 2026 20:45
@jsandoval81
Copy link
Copy Markdown
Collaborator Author

@jlkravitz This is ready for your review.

Copy link
Copy Markdown
Collaborator

@jlkravitz jlkravitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @isabeleliassen Good to merge.

@isabeleliassen isabeleliassen merged commit 451238d into csg-org:main Apr 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add encumbrance FE

4 participants